<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
        <h1 id="time"></h1>
        <button id="stop" onclick="stop()"></button>
        <button id="start" onclick="stop()"></button>
        <script>
            let interval =setInterval (function () {
                let time =document.getElementById("time");
                let str = new Date().toLocaleString();
                time.innerHTML= str;

            },1000);
            function stop() {
                clearInterval(interval);
            }

        </script>
</body>

</html>